<html xmlns:color="http://www.w3.org/1999/xhtml">
<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="IE=edge">
    <title>诊疗方案</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <link rel="stylesheet" href="../static/plugins/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="../static/plugins/adminLTE/css/AdminLTE.css">
    <link rel="stylesheet" href="../static/plugins/adminLTE/css/skins/_all-skins.min.css">
    <link rel="stylesheet" href="../static/css/style.css">
    <link rel="stylesheet" href="../static/plugins/angularjs/toaster.min.css">
    <script src="../static/plugins/jQuery/jquery-2.2.3.min.js"></script>
    <script src="../static/plugins/bootstrap/js/bootstrap.min.js"></script>

    <script type="text/javascript" src="../static/plugins/angularjs/angular.min.js"></script>
    <script type="text/javascript" src="../static/plugins/angularjs/angular-animate.min.js"></script>
    <script type="text/javascript" src="../static/plugins/angularjs/toaster.min.js"></script>

    <style>
        .tab{
            margin-left:300px;
        }
        .box-body{
            text-align:left;
        }
    </style>
    <style type="text/css">
        table,td,th
        {
            border:1px solid black;

        }
        table
        {
            text-align: center;
            margin: auto;
            width:50%;
            height: auto;
            top: auto;
            position: relative;
        }
        td
        {
            padding:30px;
        }
    </style>
    <style type="text/css">
        .return {
            display: block;
            cursor: pointer;
            width: auto;
            height: 12px;
            top: 60px;
            right: 30px;
            position: absolute;
        }
        .top{
            float: right;
            padding-right: 5px;
        }
    </style>

    <script type="text/javascript">
        var app = angular.module("drugsCatalog",[]);
        app.controller("drugCheckController",function ($scope,$http) {

            $scope.model = {
                "administrative": "",
                "followGrowp": "",
                "date": "",
                "patientNumber": "",
                "name": "",
                "sex":"",
                "age":"",
                "nextDate":"",
                "state":""
            };
            $scope.pages = function (pageNum,pageSize) {

                if (pageNum == null || pageNum == "") {
                    pageNum=$("#pagenum").val();
                }
                if (pageSize == null || pageSize==""){
                    var myselect=document.getElementById("pageSize");
                    var index = myselect.selectedIndex;
                    var optionsval = myselect.options[index].value;
                    pageSize=optionsval;
                }
                $scope.model.pageNum = pageNum;
                $scope.model.pageSize = pageSize;
                $http({
                    url: "selectDrugCatalog",
                    method: "post",
                    data: $scope.model,
                    dataType: "json",
                    headers: {'Content-Type': 'application/x-www-form-urlencoded'},
                    transformRequest: function (obj) { //在请求之前对data传参进行格式转换
                        var str = [];
                        for (var p in obj) {
                            str.push(p + "=" + obj[p]);
                        }
                        return str.join("&");
                    }
                }).success(function (data) {//请求成功并返回数据
                    $scope.pageUtil = data;
                })
            }
        });
        function fatherChecked() {
            //定义父选择器
            var father = $("[name=fathercheck]");
            //定义子选择器
            var children = $("[name=childrencheck]");
            //如果选中父选择器
            if(father.prop("checked")){
                //则子选择器全部循环遍历选中
                for (var i=0;i<children.length;i++){
                    //childre[i].checked = true;//js写法
                    //给子选择器选择属性赋值为true
                    $(children[i]).prop("checked",true);
                }
            }else{
                //否则未选中父选择器则遍历循环子选择器
                for(var i=0;i<children.length;i++){
                    //给子选择器选择属性赋值为false
                    $(children[i]).prop("checked",false);
                }
            }
        }
        function childrenChecked(){
            var father = $("[name=fathercheck]");
            var children = $("[name=childrencheck]");
            var bool = true;
            for(var i=0;i<children.length;i++){
                //如果子选择器没被选择 bool为false
                if(!children[i].checked){
                    bool=false;
                    break;
                }
            }
            father.prop("checked",bool);
        }
        function removeBeach() {
            var children = $("[name=childrencheck]");
            var array = new Array;
            var b = false;
            for (var i = 0;i < children.length;i++) {
                if (children[i].checked) {
                    b = true;
                    console.log($(children[i]).val());
                    array.push(children[i].value);
                }
            }
            if (b) {
                $.ajax({
                    url: "updateIsDel",
                    type: "post",
                    data: {
                        ids: array
                    },
                    dataType: "json",
                    success: function (data) {
                        if (data) {
                            alert("提交成功")
                            history.go();
                        } else alert("提交失败")
                    }
                })
            } else {
                alert("请选择要提交的数据")
            }
        }
        function exportCatalogAll() {
            window.location.href = "exportCatalogAll";
        }
    </script>
</head>
<body class="hold-transition skin-red sidebar-mini" ng-app="drugsCatalog" ng-controller="drugCheckController" ng-init="pages()">
<!-- .box-body -->
<toaster-container toaster-options="{'time-out': 1000,'position-class':'toast-top-center'}"></toaster-container>

<div class="box-header with-border" style="background-color: #00BFFF;color:#FFFFFF;width: 1470px">
    <h3 class="box-title">诊疗方案</h3>
    <div class="top">
        <h5 class="setting">
            <a href="" style="background-color: #00BFFF;color:#FFFFFF;">随访进度管理</a>
            <a href="" style="background-color: #00BFFF;color:#FFFFFF;">数据复核</a>
            <a href="" style="background-color: #00BFFF;color:#FFFFFF;">分组管理</a>
            <a href="" style="background-color: #00BFFF;color:#FFFFFF;">系统设置</a>
            <a href="" style="background-color: #00BFFF;color:#FFFFFF;">账号设置</a>
        </h5>
    </div>
</div>
    <div class="box-body">
        <!-- 数据表格 -->
        <div class="table-box">
            <!-- 数据表格 -->
            <div class="table-box">
                <!--工具栏-->
                <div class="pull-left">
                    <div class="form-group form-inline">
                        <div class="btn-group">
                            <!--onClick点击事件触发调用方法-->
                            <p><button id="button1" type="button" class="btn" style="background-color: #00BFFF;color:#FFFFFF">诊疗方案名称1</button></p>
                            <p><button id="button2" type="button" class="btn" style="background-color:#00BFFF;color:#FFFFFF">方案2</button></p>
                            <button id="button3" type="button" class="btn" style="background-color:#00BFFF;color:#FFFFFF" data-toggle="modal" data-target="#editModal">添加</button>
                        </div>
                        <div class="return">
                            <button type="button" class="btn" style="background-color:#00BFFF;color:#FFFFFF">返回随访组</button>
                        </div>
                    </div>
                </div>
            <!--工具栏/-->
            <!--数据列表-->
            <table id="dataList" class="table table-bordered table-striped table-hover dataTable" border="1">
                <table border="1">
                    <tr>
                        <td style="width: 63px">1.用药</td>
                        <td style="width: 189px"></td>
                    </tr>
                    <tr>
                        <td style="width: 63px">2.检验</td>
                        <td style="width: 189px"></td>
                    </tr>
                    <tr>
                        <td style="width: 63px">3.检查</td>
                        <td style="width: 189px"></td>
                    </tr>
                    <tr>
                        <td style="width: 63px">4.治疗</td>
                        <td style="width: 189px"></td>
                    </tr>
                    <tr>
                        <td style="width: 127px">5.手术</td>
                        <td style="width: 311px"></td>
                    </tr>
                    <tr>
                        <td style="width: 127px">6.通知</td>
                        <td style="width: 311px"></td>
                    </tr>
                </table>
            </table>
        </div>
    </div>
    </div>
    <div class="modal" id="editModal"tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false">
        <div class="modal-dialog" style="width:80%;">
            <div class="modal-header">
                <button id="bt" type="button" class="close" data-dismiss="modal" aria-hidden="false"></button>
                <h3 id="myModalLabe">添加页面</h3>
            </div>
            <div class="modal-body">
                <table id="dataList" class="table table-bordered table-striped table-hover dataTable" border="1">
                    <table border="1">
                        <tr>
                            <td style="width: 63px">1.用药</td>
                            <td style="width: 189px"></td>
                        </tr>
                        <tr>
                            <td style="width: 63px">2.检验</td>
                            <td style="width: 189px"></td>
                        </tr>
                        <tr>
                            <td style="width: 63px">3.检查</td>
                            <td style="width: 189px"></td>
                        </tr>
                        <tr>
                            <td style="width: 63px">4.治疗</td>
                            <td style="width: 189px"></td>
                        </tr>
                        <tr>
                            <td style="width: 127px">5.手术</td>
                            <td style="width: 311px"></td>
                        </tr>
                        <tr>
                            <td style="width: 127px">6.通知</td>
                            <td style="width: 311px"></td>
                        </tr>
                    </table>
                </table>
            </div>
</body>
</html>